<template>
  <!-- 项目信息 -->
  <div class="projectInfo">
    <div class="list-header">
      <div class="title">币种:人民币(元)</div>
    </div>
    <el-table
      stripe
      ref="multipleTable"
      :data="tableData"
      :highlight-current-row="true"
      @selection-change="handleSelectionChange"
      header-row-class-name="headerStyle"
      header-cell-class-name="headerCell"
      style="width: 100%"
    >
      <el-table-column align="center" prop="order" label="序号" type="index" />

      <el-table-column align="center" prop="name" label="供应商名称" />
      <el-table-column align="center" prop="age" label="联系人及电话" />
      <el-table-column align="center" prop="datatime" label="时间" />
      <el-table-column align="center" prop="pirce" label="类积分包金额" />
      <el-table-column align="center" prop="ip" label="详情">
        <template slot-scope="scope">
          <a
            @click="clickName"
            style="
              font-weight: 600;
              color: #316dc3;
              border-bottom: 1px solid #316dc3;
            "
            >{{ scope.row.ip }}</a
          >
        </template>
      </el-table-column>
    </el-table>
    <!--  分页-->
    <div class="pagingStyle">
      <el-pagination
        :pageSize="pageSize"
        :total="total"
        :pageNumber="pageNumber"
        background
        layout="prev, pager, next"
        @current-change="currentChange"
      />
    </div>

    <div class="warp" v-if="flag">
      <div class="dialog">
        <span class="close" @click="closeDialog"></span>
        <div class="leftTable">
          <div class="text">基本信息</div>
          <div class="line"></div>
          <div class="leftList">
            <el-table :data="tableData">
              <el-table-column
                align="center"
                prop="name"
                width="80"
                label="名称"
              />
              <el-table-column align="center" prop="name" label="内容" />
            </el-table>
          </div>
        </div>
        <div class="rightTable">
        <div class="text">项目动态<span class="el-icon-s-tools" @click="setting"></span></div>
          <div class="line"></div>
          <div class="rightList">
            <el-table :data="tableData">
              <el-table-column align="center" prop="status" label="状态">
                <template slot-scope="scope">
                  <el-tag
                    :type="scope.row.status == 1 ? 'success' : 'danger'"
                    disable-transitions
                    >{{ scope.row.status == 1 ? "合格" : "不合格" }}</el-tag
                  >
                </template>
              </el-table-column>
              <el-table-column align="center" prop="name" label="内容" />
              <el-table-column align="center" prop="datatime" label="时间" />
              <el-table-column
                prop="status"
                label="筛选"
                width="100"
                :filters="[
                  { text: '合格', value: 1 },
                  { text: '不合格', value: 2 },
                ]"
                :filter-method="filterTag"
                filter-placement="bottom-end"
              >
                <template slot-scope="scope">
                  <el-tag
                    :type="scope.row.status == 1 ? 'success' : 'danger'"
                    disable-transitions
                    >{{ scope.row.status == 1 ? "合格" : "不合格" }}</el-tag
                  >
                </template>
              </el-table-column>
            </el-table>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { list } from "@/api/list";
export default {
  data() {
    return {
      tableData: [],
      pageNumber: 1, //第一页
      pageSize: 5, //默认显示20条
      total: 0,
      params: {},
      flag: false,
      leftData: [
        {
          name: "项目名称",
          content:
            "深海社区临港家园深海社区临港家园深海社区临港家园深海社区临港家园",
        },
        {
          name: "项目客户",
          content: "上海南汇集团股份有限公司",
        },
        {
          name: "项目编号",
          content: "2017000111",
        },
        {
          name: "项目金额",
          content: "2000",
        },
        {
          name: "管理模式",
          content: "自营",
        },
        {
          name: "开始时间",
          content: "2017.10.1",
        },
        {
          name: "结束时间",
          content: "2023.10.1",
        },
      ],
      rightData: [
        {
          status: "1",
          text: "内容新科技内存接口多长时间可能",
          time: "2017.10.02",
        },
        {
          status: "2",
          text: "内容新科技内存接口多长时间可能",
          time: "2017.10.01",
        },
        {
          status: "1",
          text: "内容新科技内存接口多长时间可能",
          time: "2017.10.01",
        },
        {
          status: "2",
          text: "内容",
          time: "2017.10.01",
        },
      ],
    };
  },
  async mounted() {
    this.getList();
  },
  methods: {
    setting(){

    },
    closeDialog() {
      this.flag = false;
    },
    getList() {
      list(this.params).then((res) => {
        // let tableData= res.data.list
        this.tableData = res.data.list;
        // this.total = data.page.total;
      });
    },
    filterTag(value, row) {
      return row.status === value;
    },
    clickName(data) {
      this.flag = true;
    },
    currentChange(e) {
      this.pageNumber = e;
      this.initData();
    },
    searchAction() {
      if (this.form.sendStatus) {
        this.params.sendStatus = this.form.sendStatus;
      } else {
        this.$delete(this.form, "sendStatus");
      }
      this.pageNumber = 1;
      this.initData();
    },
    handleSelectionChange(val) {
      this.checkedData = [];
      val.forEach((item) => {
        this.checkedData.push(item.id);
      });
      // this.multipleSelection = val;
    },
  },
};
</script>
<style lang="scss" scoped>
.projectInfo {
  margin: 0 20px;
  background: #fff;
  .list-header {
    .title {
      text-align: right;
      font-size: 14px;
      line-height: 2;
      padding: 10px 0;
    }
  }
  .warp {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    overflow: auto;
    margin: 0;
    z-index: 2000;
    background: rgba($color: #000000, $alpha: 0.5);

    .dialog {
      display: flex;
      width: 50%;
      -webkit-transform: none;
      transform: none;
      left: 0;
      position: relative;
      margin: 0 auto;
      // background: #fff;
      margin-top: 15vh;
      z-index: 2000;
      .close {
        position: absolute;
        right: -50px;
        top: -50px;
        width: 50px;
        height: 50px;
        background: url("../../../assets/img/close.png") no-repeat;
        background-size: cover;
      }
      .leftTable {
        width: 30%;
        margin-right: 20px;
        background: #fff;
        border-radius: 8px;
        .text {
          font-size: 16px;
          line-height: 48px;
          text-indent: 20px;
          background: #ffffff;
          border-radius: 8px;
        }
        .line {
          width: 100%;
          height: 1px;
          background: #e9e9e9;
        }
        .leftList {
          padding: 20px;
        }
      }
      .rightTable {
        width: 68%;
        height: 100%;
        background: #fff;
        position: absolute;
        border-radius: 8px;
        height: 100%;
        right: 0;
        .line {
          width: 100%;
          height: 1px;
          background: #e9e9e9;
        }
        .text {
          font-size: 16px;
          line-height: 48px;
          background: #ffffff;
          text-indent: 20px;
          border-radius: 8px;
        }
        .rightList {
          padding: 20px;
        }
      }
    }
  }
}
/deep/ .el-icon-s-tools {
    width: 30px;
    height: 30px;
}
/deep/ .el-icon-s-tools:before {
    content: "\E7AC";
    position: absolute;
    right: 20px;
    top: 16px;
}
/deep/.el-table--enable-row-hover .el-table__body tr:hover > td {
  background-color: #dddddd;
  color: rgba(0, 0, 0, 0.65);
  font-weight: 500;
}
/deep/.el-tabs__item.is-active {
  color: #28528d;
}
/deep/.el-tabs__item.is-active {
  color: #28528d;
}
/deep/.el-tabs__item:hover {
  color: #28528d;
  cursor: pointer;
}
</style>